package com.sihan.swvp.dao.sys;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.sihan.swvp.entity.sys.Enterprise;
import com.sihan.swvp.entity.sys.User;

public interface UserDao {

//	@Select("select * from sys_user where account=#{account} and password=#{password}")
	public User getUserByPwd(@Param("account")String account,@Param("password")String password);

	public void adduser(User user);
	String getUserLogCounts(@Param("userid")String userid);
	public void addCounts(@Param("userid")String userid,@Param("counts")String counts);

	public List<Map<String, Object>> getUser(Map<String,Object> params);

	public void udpateUser(User user);

	public void deleteUser(@Param("upuser")Long upuser,@Param("ids")String ids);

	public List<Map<String, Object>> getEnterprise();
	
	public Enterprise getUserEnterprise(User user);

	public void saveConfig(@Param("userid")Long userid,@Param("configs")List<Map<String, Object>> configs);

	public List<Map<String, Object>> getConfig(User user);
	
	public List<User> getUserByAccount(@Param("account")String account);
	
	public int userNameIsExistence(@Param("account")String account,@Param("id")Long id);
	
	public User getUserById(User user);
	
	public int adminPriv(@Param("userId")Long userId);
	
	public void setUser(Map<String,Object> params);
	
	public User selectUserByAccount(@Param("account")String account);
	
	public void updateLoginErrorCount(@Param("id")Long id,@Param("newerrorcount")int newerrorcount);
	
	public void updateUserLocked(@Param("id")Long id);
	
	public void updateUserRemoveLocked(@Param("id")Long id);
	
	public void updateConn(@Param("id")Long id,@Param("isconn")int isconn);
	
	public void setConnById(@Param("id")Long id,@Param("isconn")int isconn);
	
	public int getConnCount();
}
